<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0; user-scalable=0;" />
<title>MSG 1.0</title>
<style>
    .add_button{
        border:1px #CCC solid;
        margin:5px;
        padding:5px;
        font-weight: bold;
        color:red;
    }
</style>
<link href="<?php echo base_url("public/css/main.css")?>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<?php echo base_url("public/js/jquery.1.7.min.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/spinner/ui.spinner.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/spinner/jquery.mousewheel.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/jquery-ui.1.8.min.js")?>"></script>

<script type="text/javascript" src="<?php echo base_url("public/js/plugins/charts/excanvas.min.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/charts/jquery.flot.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/charts/jquery.flot.orderBars.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/charts/jquery.flot.pie.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/charts/jquery.flot.resize.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/charts/jquery.sparkline.min.js")?>"></script>

<script type="text/javascript" src="<?php echo base_url("public/js/charts/highcharts.js")?>"></script>

<script type="text/javascript" src="<?php echo base_url("public/js/plugins/forms/uniform.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/forms/jquery.cleditor.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/forms/jquery.validationEngine-en.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/forms/jquery.validationEngine.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/forms/jquery.tagsinput.min.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/forms/autogrowtextarea.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/forms/jquery.maskedinput.min.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/forms/jquery.dualListBox.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/forms/jquery.inputlimiter.min.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/forms/chosen.jquery.min.js")?>"></script>

<script type="text/javascript" src="<?php echo base_url("public/js/plugins/wizard/jquery.form.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/wizard/jquery.validate.min.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/wizard/jquery.form.wizard.js")?>"></script>

<script type="text/javascript" src="<?php echo base_url("public/js/plugins/uploader/plupload.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/uploader/plupload.html5.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/uploader/plupload.html4.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/uploader/jquery.plupload.queue.js")?>"></script>

<script type="text/javascript" src="<?php echo base_url("public/js/plugins/tables/datatable.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/tables/tablesort.min.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/tables/resizable.min.js")?>"></script>

<script type="text/javascript" src="<?php echo base_url("public/js/plugins/ui/jquery.tipsy.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/ui/jquery.collapsible.min.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/ui/jquery.prettyPhoto.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/ui/jquery.progress.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/ui/jquery.timeentry.min.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/ui/jquery.colorpicker.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/ui/jquery.jgrowl.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/ui/jquery.breadcrumbs.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/ui/jquery.sourcerer.js")?>"></script>

<script type="text/javascript" src="<?php echo base_url("public/js/plugins/elfinder.min.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/plugins/calendar.min.js")?>"></script>
<script type="text/javascript" src="<?php echo base_url("public/js/custom.js")?>"></script>
<!-- input mask -->
<script type="text/javascript" src="<?php echo base_url("public/js/jquery.maskedinput.js")?>"></script>
</head>

<body>

<!-- Left side content -->
<div id="leftSide">
    <div class="logo"><a href="<?php echo base_url()?>"><img src="<?php echo base_url('/public/images/logo.png')?>" alt="" /></a></div>
    
    <div class="sidebarSep mt0"></div>
    
<!---->
    <!-- Left navigation -->
    <ul id="menu" class="nav">
    <li class="charts"><a href="#" title="" class="current"><span>Danh mục 1</span></a>
            <ul class="sub">
                 
                <li><a href="#" title="">Sub 1</a></li>
                
                <li class="last"><a href="#">Sub last</a></li>
            </ul>        
        </li>
          
        
    </ul>
</div>


<!-- Right side -->
<div id="rightSide">

    <!-- Top fixed navigation -->
    <div class="topNav">
        <div class="wrapper">
            <div class="welcome"><a href="#" title=""><img src="<?php echo base_url('public/images/userPic.png')?>" alt="" /></a><span>Xin chào: <?php echo  $this->session->userdata('email')?> [<a href="<#>Thoát</a>]    </span></div>
          
            <div class="clear"></div>
        </div>
    </div>
    
    <!-- Responsive header -->
    <div class="resp">
        <div class="respHead">
            <a href="<?php echo base_url()?>" title=""><img src="<?php echo base_url('public/images/loginLogo.png')?>" alt="" /></a>
        </div>
 
    </div>
    
    <!-- Title area -->
    <div class="titleArea">
    
    </div>
 
    <div class="line"></div>
     <div class="wrapper">
    <?php echo $content_for_layout; ?>
 
    </div>
    </div>
     
    <!-- Main content wrapper -->

    </div>
    
    <!-- Footer line -->
    <div id="footer">
        <div class="wrapper">Phát triển bởi Luonghx</div>
    </div>

 
  
    <script>
    
      $(function() {
         $("#quick_sell").click(function(){
            $( "#dialog-confirm" ).dialog({
            resizable: false,
            height:650,
            width:850,
            modal: true,
            buttons: {
               
                Cancel: function() {
                $( this ).dialog( "close" );
                }
            }
        });
});
});
 function admCheck(){
            this.calculator = function(a){
               var  name = $("#productName_"+a).val(),
                    quantity = parseInt($("#productQuantity_"+a).val()),
                    price = parseInt($("#productPrice_"+a).val()),
                    total = 0;
                  
                    
                    if(name && quantity && price){
                        $('#money_'+a).val(quantity*price);
                        $('#spanMoney_'+a).html(this.formatCurrency(quantity*price));
                        $("#money_pre_discount").html(this.formatCurrency(this.calc_total()));
                        this.calc_discount();
                    }
            },
            this.calc_total = function(){
                var total = 0;
                for(var j =0;j<=5;j++){
                   if(parseInt($("#money_"+j).val())){
                        total += parseInt($("#money_"+j).val());
                    }
                }
                return total;    
            },
            this.calc_discount = function(){
                var discount = parseInt($("#discount").val()),
                    total = parseInt(this.calc_total()),
                    money = total;
                    
                    money = (discount > 0) ? (total  - total*discount/100) : total;
                    
                    $("#thanhtoan").html(this.formatCurrency(money));
                    
                    
                 
            },
            this.submitForm = function(){
                var k = 0;
                 for(var i = 1;i<=5;i++){
                  
                    if($("#productName_"+i).val() && $("#productPrice_"+i).val() && $("#productQuantity_"+i).val()){
                        k++;
                    }
                 }
                 if( k < 1){
                    alert('Bạn phải nhập sản phẩm. Phải nhập đủ thông tin: Tên sản phẩm, Đơn giá, Số lượng');
                    return false;
                 }
                
                 return true;
            },
            this.formatCurrency=function(num) 
             {
                num = num.toString().replace(/\$|\,/g,'');
                if(isNaN(num))
                num = "0";
                sign = (num == (num = Math.abs(num)));
                num = Math.floor(num*100+0.50000000001);
                num = Math.floor(num/100).toString();
                for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
                num = num.substring(0,num.length-(4*i+3))+','+
                num.substring(num.length-(4*i+3));
                return (((sign)?'':'-') + num);
            }
        }
        var checkForm = new admCheck();

    </script>
<div class="clear"></div>

</body>
</html>